package oop2;

/**
 * @author oldliu
 * @since 1.0
 */
public class MySchool {
    //属性
    //成员变量
    public String name;
    public int labs;//机房
    public int rooms;//教室数目

    //两个属性:name和labs
    public MySchool(String name,int labs){
        this.name=name;
        this.labs=labs;
    }
    //一个name
    public MySchool(String name){
        //this.name=name;
        this(name,0,0);
        System.out.println("只有一个name的构造方法");
    }
    //两个：name和rooms
    public MySchool(int rooms,String name){
        //this.name=name;
        //this.rooms=rooms;
        this(name,0,rooms);
        System.out.println("给了名称和教室数量的构造方法");
    }
    //全部属性
    public MySchool(String n,int a,int m){
        name=n;
        labs=a;
        rooms=m;
        show();
    }

    //介绍这个学校的情况
    public void show() {
        //this("sss");
        System.out.println("这个学校叫" + name + "\n有" + labs + "机房，" + rooms + "间教室");
    }
}
